#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow), scene(new QGraphicsScene(this)),view(new QGraphicsView(scene,this))
{
    ui->setupUi(this);
    setMinimumSize(1000, 600);
    scene->setSceneRect(0, 0, 1200, 800);
    view->setFixedSize(1000, 500);

    // 输入区（情绪内容）
    ui->lineEdit->setPlaceholderText("输入你的烦恼");
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_createPaperBallButton_clicked()
{
    QString content = ui->lineEdit->text().trimmed();
    if (content.isEmpty()) return;

    //生成纸团
    PaperBall *ball = new PaperBall(content);
    ball->setPos(200,200);
    scene->addItem(ball);
}

